<?php namespace Controller;

class Usuarios extends Controller {

	function __construct() {
		$this->models = array("Usuarios");
		$this->_loadModels();
	}

	public function login() {
		if(!empty($this->form) && $this->form["password"]=='admin') {
			$_SESSION["login"] = 1;
			header(DEFAULT_LOCATION);
			exit;
		} else {
			return $this;
		}	
	}
	
	public function logout() {
		session_destroy();
		header(LOGIN_LOCATION);
		exit;
	}

}